var fs = require('fs'),
	fileList = [];
//path模块，可以生产相对和绝对路径
var path = require("../node_modules/path/path");

function walk(path){
	var dirList = fs.readdirSync(path);
	dirList.forEach(function(item){
		if(fs.statSync(path + '/' + item).isDirectory()){
			walk(path + '/' + item);
		}else{
			fileList.push(path + '/' + item);
		}
	});
}
var filePath = path.resolve() + "/upload/"; 
walk(filePath);
 
console.log(fileList);
function Filelist()
{
	var filePath = path.resolve() + "/upload/"; 
	walk(filePath);
	 
	console.log(fileList);
}

